Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

split-string

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split-string

Split a string on a character except when the character is escaped.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.2M
decreased by-32.28%
Maintainers
2
Weekly downloads
 
Created

What is split-string?

The split-string npm package is used to split strings on a specified separator while respecting nested structures such as quotes, brackets, and parentheses. It provides a way to parse complex strings with multiple levels of nested delimiters.

What are split-string's main functionalities?

Basic string splitting

Splits a string into an array of substrings using the specified separator.

"a.b.c".split('.')

Splitting with escaped characters

Splits a string on a separator while allowing escaped characters to be included in the results.

splitString('a\.b.c', { separator: '.' })

Splitting with brackets

Splits a string on a separator while respecting nested brackets, keeping them as part of the split segments.

splitString('a.{b.c}.d', { brackets: true })

Customizing separators and brackets

Allows customization of separators and bracket pairs for more complex string splitting scenarios.

splitString('a.{b.c}.d', { separators: ['.', ' '], brackets: { '{': '}' } })

Other packages similar to split-string

Keywords

FAQs

Package last updated on 11 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc